package xhwl.insurance.view;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StyleRes;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import xhwl.insurance.R;

import static com.umeng.socialize.utils.DeviceConfig.context;

/**
 * Created by Administrator on 2017/10/31.
 */

public class SelfDialog {

    private Dialog mDialog;
    private Context mContext;
    private final LayoutInflater mLayoutInflater;

    public SelfDialog(Context context) {
        mLayoutInflater = LayoutInflater.from(context);
        mContext = context;
    }

    public void showDialog(){
        mDialog = new Dialog(mContext, R.style.Dialog_Theme);
        View view = mLayoutInflater.inflate(R.layout.short_dialog,null,false);
        mDialog.setContentView(view);

        ImageView iv_icon = (ImageView) mDialog.findViewById(R.id.iv_icon);
        TextView tv_label = (TextView) mDialog.findViewById(R.id.tv_label);

        mDialog.show();
    }


    public void dismissDialog(){
        if (mDialog != null && mDialog.isShowing()){
            mDialog.dismiss();
            mDialog = null;
        }
    }
}
